/*
 *  linux/kernel/traps.c
 *
 *  (C) 1991  Linus Torvalds
 */

/*
 * 'Traps.c' handles hardware traps and faults after we have saved some
 * state in 'asm.s'. Currently mostly a debugging-aid, will be extended
 * to mainly kill the offending process (probably by giving it a signal,
 * but possibly by killing it outright if necessary).
 */

#include "uart0.h"
#include "my_printf.h"

void rt_hw_trap_undef()
{
	uart0_init();

	uart0_putchar(' ');
	uart0_putchar('U');
	uart0_putchar('N');
	uart0_putchar('D');
	uart0_putchar(' ');
}

void rt_hw_trap_swi()
{
	uart0_init();

	uart0_putchar(' ');
	uart0_putchar('S');
	uart0_putchar('W');
	uart0_putchar('I');
	uart0_putchar(' ');
}

void rt_hw_trap_pabt()
{
	uart0_init();

	uart0_putchar(' ');
	uart0_putchar('P');
	uart0_putchar('A');
	uart0_putchar('B');
	uart0_putchar('T');
	uart0_putchar(' ');
}

void rt_hw_trap_dabt()
{
	uart0_init();

	uart0_putchar(' ');
	uart0_putchar('D');
	uart0_putchar('A');
	uart0_putchar('B');
	uart0_putchar('T');
	uart0_putchar(' ');
}

void rt_hw_trap_resv()
{
	uart0_init();

	uart0_putchar(' ');
	uart0_putchar('R');
	uart0_putchar('E');
	uart0_putchar('S');
	uart0_putchar('V');
	uart0_putchar(' ');
}

void rt_hw_trap_irq()
{
	uart0_init();

	uart0_putchar(' ');
	uart0_putchar('I');
	uart0_putchar('R');
	uart0_putchar('Q');
	uart0_putchar(' ');
}

void rt_hw_trap_fiq()
{
	uart0_init();

	uart0_putchar(' ');
	uart0_putchar('F');
	uart0_putchar('I');
	uart0_putchar('Q');
	uart0_putchar(' ');
}
